#pragma once

namespace Tmpl {

class Goal;
class Entity;
class EntityLogic
{
public:
	Entity* GetOwner(){return mOwner;}

	bool HandleMessage(const MsgData& msg);

	void Render() const;

private:
	friend class EntityLogicSystem;

	Entity* mOwner;
	Goal* mGoals;
};

class EntityLogicSystem
{
public:
	static void Init();
	static void Clear();

	static int NewLogic(Entity* owner);
	static void RemoveLogic(int id);
	static EntityLogic* GetLogic(int id);

	static JobHandle Update(JobHandle dependency);

private:
	static void UpdateLogicChunk(int chunk);
};

} // namespace Tmpl